<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- footer -->
	<link rel="stylesheet" href="css/amazeui.min.css">
    <link rel="stylesheet" href="css/petshow.css?6">
    <link rel="stylesheet" href="css/animate.min.css">
     <script src="js/jquery.min.js"></script>
    <script src="js/amazeui.min.js"></script>
    <script src="js/amazeui.lazyload.min.js"></script>
    
    
	
<title>我的购物车</title>
<!-- Javascript goes in the document HEAD -->
<script type="text/javascript">
function altRows(id){
	if(document.getElementsByTagName){  
		
		var table = document.getElementById(id);  
		var rows = table.getElementsByTagName("tr"); 
		 
		for(i = 0; i < rows.length; i++){          
			if(i % 2 == 0){
				rows[i].className = "evenrowcolor";
			}else{
				rows[i].className = "oddrowcolor";
			}      
		}
	}
}

window.onload=function(){
	altRows('alternatecolor');
}
</script>
<style type="text/css">

#submit{
width:1000px;
height:70px;
font:30px;
margin:0 auto;
margin-top:20px;
}
.info{
width:1000px;
height:70px;
font:30px;
margin:0 auto;
margin-top:10px;
margin-bottom:10px;

}
.item{
width:1000px;
height:100px;
margin:0 auto;

margin-top:10px;
}
.itemButton{
width:50px;
height:50px;
float:right;
}

a{text-decoration:nine;color:white;}

<!--按钮样式-->
.btn {  
    position: relative;  
    cursor: pointer;  
    display: inline-block;  
    vertical-align: middle;  
    font-size: 12px;  
    font-weight: bold;  
    height: 27px;  
    line-height: 27px;  
    min-width: 52px;  
    padding: 0 12px;  
    text-align: center;  
    text-decoration: none;  
    border-radius: 2px;  
    border: 1px solid #939391;  
    color: #666;  
    background-color: #939391;  
    background: -webkit-linear-gradient(top, #939391, #939391);  
    background: -moz-linear-gradient(top, #939391, #939391);  
    background: linear-gradient(top, #939391, #939391);  
}  
  
.btn-primary {  
    border-color: #939391;  
    color: #F3F7FC;  
    background-color: #939391;  
    background: -webkit-linear-gradient(top, #939391, #939391);  
    background: -moz-linear-gradient(top, #939391, #939391);  
    background: linear-gradient(top, #939391, #939391);  
}  
<!-- CSS goes in the document HEAD or added to your external stylesheet -->

table.altrowstable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #939391;
	border-collapse: collapse;
}
table.altrowstable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #939391;
	border-collapse:separate; 
    border-spacing: 2px;
}
table.altrowstable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #939391;
}
.oddrowcolor{
	background-color:#BFBFBF;
}
.evenrowcolor{
	background-color:#ECECEA;
}
</style>

</head>
<body>
<form></form>

<header class="am-topbar am-topbar-inverse">
    <div class="amz-container">
        <h1 class="am-topbar-brand">
            <a href="#" class="am-topbar-logo">
                <img src="img/foodLogo.jpg?1" alt="">
            </a>
        </h1>
        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only"
        data-am-collapse="{target: '#doc-topbar-collapse-5'}">
            <span class="am-sr-only">
                导航切换
            </span>
            <span class="am-icon-bars">
            </span>
        </button>
        <div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse-5">
            <ul class="am-nav am-nav-pills am-topbar-nav">
                <li class="am-active">
                    <a href="shops.jsp">
                        首页
                    </a>
                </li>
                <li class="am-dropdown" data-am-dropdown="">
                    <a class="am-dropdown-toggle" data-am-dropdown-toggle="" href="javascript:;">
                        个人中心
                        <span class="am-icon-caret-down">
                        </span>
                    </a>
                    <ul class="am-dropdown-content">
                        <li>
                            <a href="UserInfo.jsp">
                                收货地址
                            </a>
                        </li>
                        <li>
                            <a href="UserInfo.jsp">
                                我的收藏
                            </a>
                        </li>
                        <li>
                            <a href="UserInfo.jsp">
                                全部订单
                            </a>
                        </li>
                        <li>
                            <a href="UserInfo.jsp">
                                每日精选
                            </a>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="#">
                        我的购物车
                    </a>
                </li>
                <li>
                    <a href="#">
                        注销
                    </a>
                </li>
                <li class="am-dropdown" data-am-dropdown="">
                    <a class="am-dropdown-toggle" data-am-dropdown-toggle="" href="javascript:;">
                        加盟合作
                        <span class="am-icon-caret-down">
                        </span>
                    </a>
                    <ul class="am-dropdown-content">
                        <li>
                            <a href="BusinessRegist.jsp">
                                商家入驻
                            </a>
                        </li>
                        <li>
                            <a href="BusinessRegist.jsp">
                                配送加盟
                            </a>
                        </li>
                        <li>
                            <a href="BusinessRegist.jsp">
                                媒体公关
                            </a>
                        </li>
                        <li>
                            <a href="BusinessRegist.jsp">
                                代理申请
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</header>
<div id="">
<div class="info">hello</div>
<table  class="altrowstable" id="alternatecolor" align="center" width="1000">
<tr height="15">
<th></th>
<th>菜品名称</th>
<th>菜品价格</th>
<th>商家</th>
<th>数量</th>
<th></th>
<th></th>
</tr>
<%
Connection conn=DBConnect.MySQLConnect();

try{
	//int u_id=Integer.parseInt(request.getParameter("u_id"));
	//Class.forName(driverName);
    //conn = DriverManager.getConnection(dbURL, userName, userPwd);
    Statement stmt=conn.createStatement();
	String sql="select * from cartitem where ci_cartId=2";
	ResultSet rs=stmt.executeQuery(sql);
	int i=0;
	double totalPrice=0;
	List<String> cartItem=new ArrayList<String>();
	session.setAttribute("Item", cartItem);
	List<String> ciName=new ArrayList<String>();
	List<String> ciPrice=new ArrayList<String>();
	List<String> ciShopName=new ArrayList<String>();
	List<String> ciQuantity=new ArrayList<String>();
	//System.out.println("1111111");
	while(rs.next()){
	//	System.out.println("1111111");
		ciName.add(rs.getString("ci_name"));
		ciPrice.add(rs.getString("ci_itemPrice"));
		ciShopName.add(rs.getString("ci_id"));//试试
		ciQuantity.add(rs.getString("ci_cartId"));//试试
	
%>
<tr>
<td height="50"></td>
<td><%=ciName.get(i)%></td>
<td><%=ciPrice.get(i)%></td>
<td><%=ciShopName.get(i)%></td>
<td><%=ciQuantity.get(i)%></td>
<td><button class="btn btn-primary">编辑</button></td>
<td><button class="btn btn-primary"><a href="DeleteItemServlet?ci_name=<%=ciName.get(i)%>">移除</a></button></td>
</tr>



<%
i++;
	}
}
catch(Exception e) {
    e.printStackTrace();
   } 

%>
</table>
</div>
<div id="submit">
<button class="btn btn-primary submit" onclick="submit()">确认购买</button>
</div>
<script>
function submit(){
window.location.href="payment.jsp";
}
</script>

<footer class="am_footer">
<div class="am_footer_con">
<div class="am_footer_link">
<span>关于食否</span>
<ul>
  <li><a href="###">关于我们</a></li>
  <li><a href="###">发展历程</a></li>
  <li><a href="###">友情链接</a></li>
</ul>
</div>


<div class="am_footer_don">
<span>食否</span>
<dl>
  <dt><img src="img/foodLogo.jpg?1" alt=""></dt>
  <dd>为您提供各类美食网上订餐服务，覆盖周边100余家餐厅，中餐、西餐、美食小吃、快餐、火锅、川菜应有尽有，不用出门即可享受各地区各种类美食！
  <a href="###" class="footdon_pg "><div class="foot_d_pg am-icon-apple ">  App store</div></a><a href="###" class="footdon_az animated"><div class="foot_d_az am-icon-android ">  Android</div></a></dd>

</dl>
</div>

<div class="am_footer_erweima">
<div class="am_footer_weixin"><img src="img/wx2.jpg" alt=""><div class="am_footer_d_gzwx am-icon-weixin"> 关注微信</div></div>
<div class="am_footer_ddon"><img src="img/wx.jpg" alt=""><div class="am_footer_d_dxz am-icon-cloud-download"> 扫码下载</div></div>

</div>

</div>
<div class="am_info_line">Copyright(c)2017 <span>ShiFou</span> All Rights Reserved </div>
</footer>
<script src="assets/jquery-3.1.1.min.js" ></script>
	<script src="assets/layer/layer.js" type="text/javascript"></script>
	<script src="js/socketAction.js" type="text/javascript"></script>
	<script src="js/submitAction.js" type="text/javascript"></script>
</body>
</html>